/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function updateCart(id)
{
   var qty = document.getElementById("qty"+id).value;
	$.ajax({
		  type: "GET",
		  url : "http://localhost:8080/UserInterface/updateOrder?id="+id+"&qty=" +qty
	}).done(function(msg) {
    //alert("amount = " + msg);
    //var cartval = document.getElementById("newcart").value;
    $("#newcart").html(" " + msg);
    

         $("#newcart").addClass('newItemGlow2');

         setTimeout(function(){
             $("#newcart").removeClass('newItemGlow2');
         }, 700)


  

    });
}


function removeCart(id, qty)
{
	$.ajax({
		  type: "GET",
		  url : "http://localhost:8080/UserInterface/updateOrder?id="+id+"&qty=" +qty
	}).done(function(msg) {
    //alert("WORKS! " +id);
    var item = document.getElementById("itemrow"+id);
    item.parentNode.removeChild(item);
    $("#newcart").html(" " + msg);

     $("#newcart").addClass('newItemGlow2');

         setTimeout(function(){
             $("#newcart").removeClass('newItemGlow2');
         }, 700)
});
}